package vue;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JPanel;

import manager.ColorManager;

public class Pion extends JPanel {
		
	private Color couleur;
	private ColorManager cm = new ColorManager();
	
	public Pion()
	{
		this.couleur = cm.getColor(-1);
	}
	
		public Pion(Color c)
		{
			this.couleur = c;
		}
	
		public void paintComponent(Graphics g) {
			super.paintComponent(g);
			Color c = g.getColor();
			g.setColor(couleur);
			g.fillOval(20,20,40,40);
			g.setColor(c);
		}
		
		public JPanel setColor(Color c)
		{
			this.couleur = c;
			this.repaint();
			return this;
		}
		
		public Color getColor()
		{
			return this.couleur;
		}
}
